/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kimstore.utilities;

import com.kimstore.bean.Staff;
import com.kimstore.bean.User;
import com.kimstore.factory.DaoFactory;

/**
 *
 * @author Administrator
 */
public class Session {
    
    private User user;
    private Staff staff;
    private static Session _instance;
    
    public static Session getInstance(){
        if(_instance == null){
            _instance = new Session();
        }
        return _instance;
    }
    
    public void setUser(User user){
        this.user = user;
        this.staff = DaoFactory.getInstance().getStaffDao().findByUser(user);
    }
    
    public User getUser(){
        return this.user;
    }
    
    public void clearUser(){
        this.user = null;
    }
    
    public Staff getStaff() {
        return staff;
    }
    
}
